//
//  ExamArrangementTableViewController.m
//  CoachsBook
//
//  Created by huiyong li on 2022/8/18.
//

#import "ExamArrangementTableViewController.h"
#import "OneTabButView.h"
#import "ExamArrangementCell.h"
#import "AddExamArrangementViewController.h"

@interface ExamArrangementTableViewController ()<UITableViewDelegate,UITableViewDataSource,OneTabButViewDelegate>

@end


@implementation ExamArrangementTableViewController



- (void)viewDidLoad {
    [super viewDidLoad];
    self.navgationheadv.titlelabel.text = @"考试安排";
    OneTabButView *tabbutview = [[OneTabButView alloc]initWithFrame:CGRectMake(0, APPheight-SafeAreaBottomHeight-65, APPwidth, 65)];
    tabbutview.delegate = self;
    [tabbutview.tabbut setTitle:@"录入考试安排" forState:UIControlStateNormal];
    [self.view addSubview:tabbutview];
    
    [self getData];
}

- (void)setupUI {
    [super setupUI];
    self.tableView.frame = CGRectMake(0, SafeAreaTopHight, APPwidth, APPheight-SafeAreaTopHight-SafeAreaBottomHeight-65);
}


- (void)getData
{
    
}


#pragma mark - UITableViewDelegate,UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//    return self.dataArray.count;
    return 10;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 220;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ExamArrangementCell *cell=[tableView dequeueReusableCellWithIdentifier:@"ExamArrangementCell"];
    if (!cell) {
        cell=[[ExamArrangementCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"ExamArrangementCell"];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    [cell.messageBut addTarget:self action:@selector(messageButCheng:) forControlEvents:UIControlEventTouchUpInside];
    cell.messageBut.tag = indexPath.row;
    [cell.weChatBut addTarget:self action:@selector(weChatButCheng:) forControlEvents:UIControlEventTouchUpInside];
    cell.weChatBut.tag = indexPath.row;
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 15;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView *view = [[UIView alloc]init];
    view.backgroundColor = [UIColor whiteColor];
    return view;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    AddExamArrangementViewController *vc = [[AddExamArrangementViewController alloc]init];
    vc.VCType = 2;
    [self.navigationController pushViewController:vc animated:YES];
}



#pragma mark -短信通知
-(void)messageButCheng:(UIButton *)but
{

}
#pragma mark -微信通知
-(void)weChatButCheng:(UIButton *)but
{
    
}



#pragma mark -OneTabButViewDelegate(录入)
- (void)OneTabButViewBtnSelectedDelegate:(NSInteger)tag
{
    AddExamArrangementViewController *vc = [[AddExamArrangementViewController alloc]init];
    vc.VCType = 1;
    [self.navigationController pushViewController:vc animated:YES];
}


@end
